@echo off
REM Run the check remote shared connections script with admin privileges
REM Automatically checks and requests admin rights

REM Check if running as administrator
net session >nul 2>&1
if %errorLevel% == 0 (
    echo Running with administrator privileges
    powershell -ExecutionPolicy Bypass -File "%~dp0CheckRemoteSharedConnections.ps1" -CheckIntervalSeconds 30 -LogToFile $true
) else (
    echo Requesting administrator privileges...
    powershell -Command "Start-Process -Verb RunAs -FilePath 'powershell' -ArgumentList '-ExecutionPolicy Bypass -File \"%~dp0CheckRemoteSharedConnections.ps1\" -CheckIntervalSeconds 30 -LogToFile $true'"
)

pause